package cn.iocoder.yudao.adminserver.modules.system.dal.mysql.feedback;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.feedback.SysFeedbackDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.adminserver.modules.system.controller.feedback.vo.*;

/**
 * 问题反馈 Mapper
 *
 * @author hickteam
 */
@Mapper
public interface SysFeedbackMapper extends BaseMapperX<SysFeedbackDO> {

    default PageResult<SysFeedbackDO> selectPage(SysFeedbackPageReqVO reqVO) {
        return selectPage(reqVO, new QueryWrapperX<SysFeedbackDO>()
                .eqIfPresent("description", reqVO.getDescription())
                .eqIfPresent("data_status", reqVO.getDataStatus())
                .eqIfPresent("creator", reqVO.getCreator())
                .eqIfPresent("type", reqVO.getType())
                .orderByDesc("id")        );
    }

    default List<SysFeedbackDO> selectList(SysFeedbackExportReqVO reqVO) {
        return selectList(new QueryWrapperX<SysFeedbackDO>()
                .eqIfPresent("description", reqVO.getDescription())
                .eqIfPresent("data_status", reqVO.getDataStatus())
                .eqIfPresent("creator", reqVO.getCreator())
                .eqIfPresent("type", reqVO.getType())
                .orderByDesc("id")        );
    }

}
